<?php
include_once('common/header.php');
if($AppUI->id <= 0 || (isset($_SESSION['slideshow']) && (($_SESSION['slideshow']&1<<3)==0))) {
	$this->_redirect(HOST_BACKEND);
}
$intImageId 	= $objRequest->getParam('imgid', 0);
$intAlbumId 	= $objRequest->getParam('albumid', 0);
$strBackUrl		= isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : HOST_BACKEND;
$intError		= 0;
if($intImageId && $intAlbumId) {
	$objProduct	= new Product();
	$intError		= $objProduct->deleteImage($AppUI->id, $intImageId, $intAlbumId);
} else {
	$intError	= 1;
}
if($intError == 0) {
	PhungTK_Function::setMsg($arrMessage[10]);
} else {
	PhungTK_Function::setError($arrError[$intError]);	
}
$this->_redirect($strBackUrl);
?>